#ifndef NIXONBOT_CORE_BNCS_PROTOCOL_HEADER_H_
#define NIXONBOT_CORE_BNCS_PROTOCOL_HEADER_H_

#include <QtCore>

namespace nixonbot {
namespace core {
namespace bncs {
namespace protocol {

struct HeaderData : public QSharedData
{
	quint8 startByte;
	quint8 messageId;
	quint16 packetLen;
};

class Header
{
public:
	QSharedDataPointer<HeaderData> d;

public:
	int size();
	friend QDataStream& operator>> (QDataStream& in, Header& data);
	friend QDataStream& operator<< (QDataStream& out, const Header& data);
};

}
}
}
}

#endif /* NIXONBOT_CORE_BNCS_PROTOCOL_HEADER_H_ */
